<?php

	/**
	 * File : settings.php
	 * Description : Page de configuration de Phenix
	 * Date : 07.08.2012 15:29:30
	 * 
	 * This file is part of Phenix.  Phenix is free software: you can
	 * redistribute it and/or modify it under the terms of the GNU General Public
	 * License as published by the Free Software Foundation, version 2.
	 *
	 * This program is distributed in the hope that it will be useful, but WITHOUT
	 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
	 * FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
	 * details.
	 *
	 * You should have received a copy of the GNU General Public License along with
	 * this program; if not, write to the Free Software Foundation, Inc., 51
	 * Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
	 *
	 * Nils Schaetti <n.schaetti@gmail.com>
	**/

	// Model
	define('MODEL','models/main/computers.php.html');

	// Includes
	require_once('core/libphenix.php');
	require_once('KTK/ktk.php');

	// Buffering
	ob_start();

	// Démarre la session
	session_start();
	
	// Paramètres du modèle
	$params = array();
	
	// Nouvel entête
	$header = new ktkHtmlHeader('KTK/css/style.css','','Phenix Web Grid');
	$header->addCSSFile('css/style.css');
	$params['@@_HEADER_@@'] = $header->getCode();
	
	// Connexion ssh
	if(!($ssh_handler = lp_ssh_connect('localhost',$_SESSION['username'],$_SESSION['password'])))
	{
		echo "Erreur de connexion<br>";
		exit;
	}
	
	// Variables GET
	if(!isset($_GET['dir']))
		$dir = '.';
	else
		$dir = $_GET['dir'];
	
	// Envoi le code
	$params['@@_HEADERBAR_@@'] = phenix_HeaderBar();
	
	// Envoi le code
	$params['@@_MENUBAR_@@'] = phenix_MainToolBar('','main/');

	// Pied de page HTML
	$params['@@_FOOTER_@@'] = ktkHTMLFooter();
	
	// Envoi le modèle
	echo sbGetModel(MODEL, $params);

	// Ferme la connexion ssh
	lp_ssh_close($ssh_handler);	

	// Fin buffering
	ob_end_flush();

?>

